package cn.hutool.core.io.unit;

import org.junit.Test;

import static org.assertj.core.api.AssertionsForClassTypes.assertThat;

public class DataSizeUtilTest {
    @Test
    public void test() {
        long d = 15651521354531L;
        assertThat(DataSize.parse("14576.62 GB")).isEqualTo(DataSize.of(15651526546554L, DataUnit.BYTES));

        assertThat(DataSizeUtil.format(d)).isEqualTo("14.23 TB");
        assertThat(DataSizeUtil.format(d, DataUnit.GIGABYTES)).isEqualTo("14576.62 GB");
    }
}